{include file=$header_start}
{strip}
<script src="{$siteroot}/includes/js/admin/editpostjob.js" type="text/javascript"></script>
<script src="{$siteroot}/includes/js/admin/ajax.js" type="text/javascript" ></script>
{/strip}
{include file=$header_end}


{literal}
<script type="text/javascript">

function showJobType(jid)
{
	if(jid!='')
	{
		ajax.sendrequest("GET",SITEROOT + "/modules/register/show_jobtype.php",{jobtypeid:jid},"","isJobType");
	}
	else
		document.getElementById('jobtype').value='';
}

</script>
{/literal}

 <div class="contain">
 
      {include file=$left_menu}
      
      <div class="right_contain">
        
         <div class="heading_box">Edit Job Post</div>
         <div class="whitebox">
         <!--Message Div Start-->
         {if $msg}
         <div class="masg_div">
           {$msg}
         </div>
         {/if}
         <!--Message Div End-->
         
         <form name="frmEditjob" id="frmEditjob" action="" method="post"  enctype="multipart/form-data">
         <input type="hidden" name="hidden_jobid" id="hidden_jobid" value="{$smarty.get.id|base64_decode}" />
         <div style="min-height:250px;">
          <!--Form Contain start-->
           
           <div class="form_fieldbox">
             <dl>
              <dt>Trade Category:<span class="error">*</span></dt>
              <dd><select class="select" name="trade" id="trade" onchange="showJobType(this.value);">
              <option value="">Select Trade Category</option>
               {section name=i loop=$newtradecategoryArray}
                     	<option value="{$newtradecategoryArray[i].id}" {if $job_details.trade_id eq $newtradecategoryArray[i].id} selected="selected" {/if}>{$newtradecategoryArray[i].trade_category}</option>
               {/section} 
              </select>
              </dd>
              <div class="clear"></div>
             </dl>
             
             <dl>
              <dt>Job Type:<span class="error">*</span></dt>
              <dd>
               <div id="isJobType">
              <select class="select" name="jobtype" id="jobtype">
              <option value="">Select Job Type</option>
             {section name=i loop=$jobtypeArray}
                <option value="{$jobtypeArray[i].id}" {if $job_details.jobtype_id eq $jobtypeArray[i].id} selected="selected" {/if}>{$jobtypeArray[i].trade_category}</option>
             {/section} 
              </select>
              </div>
              </dd>
              <div class="clear"></div>
             </dl>
             
             <dl>
              <dt>Job Description:<span class="error">*</span></dt>
              <dd><textarea id="job_desc" name="job_desc" rows="5" cols="45" class="textarea" >{$job_details.job_desc}</textarea></dd>
              <div class="clear"></div>
             </dl>
             
             <dl>
              <dt>Work Start In:<span class="error">*</span></dt>
              <dd><select name="work_to_start" id="work_to_start" class="select" >
                        	<option value="">- Select -</option>
                            <option value="asap" {if $job_details.workstart eq 'asap'} selected="selected" {/if}>As soon as possible</option>
                            <option value="1 week" {if $job_details.workstart eq '1 week'} selected="selected" {/if}>1 week</option>
                            <option value="2 weeks" {if $job_details.workstart eq '2 weeks'} selected="selected" {/if}>2 weeks</option>
                            <option value="1 month" {if $job_details.workstart eq '1 month'} selected="selected" {/if}>1 month +</option>
                        	</select></dd>
              <div class="clear"></div>
             </dl>
                          
             <dl>
              <dt>Approx Budget:<span class="error">*</span></dt>
              <dd><select class="select" name="approx_budget" id="approx_budget">
              <option value="">Select an approx budget</option>
			 	{section name=i loop=$getallactivebudgetArray}
                	<option value="{$getallactivebudgetArray[i].budget_id}" {if $job_details.approx_budget eq $getallactivebudgetArray[i].budget_id} selected="selected" {/if}>Under ${$getallactivebudgetArray[i].budget_name}</option>
            	{/section}                                            </select></dd>
              <div class="clear"></div>
             </dl>
             
             <dl>
              <dt>Postal Code:<span class="error">*</span></dt>
              <dd><input type="text" class="input" name="postcode" id="postcode" value="{$job_details.area}" maxlength="15"/></dd>
              <div class="clear"></div>
             </dl>
			 
			 <dl>
              <dt>Select State:<span class="error">*</span></dt>
              <dd><select class="select" name="state_id" id="state_id">
              <option value="">Select State</option>
			 	{section name=i loop=$stateArray}
						<option value="{$stateArray[i].state_id}" {if $job_details.state_id eq $stateArray[i].state_id} selected="selected"  {/if}>{$stateArray[i].state_name}</option>
						{/section}                                         </select></dd>
              <div class="clear"></div>
             </dl>
			 
			 
             
            <dl>
                <dt><label>Job Photo : </label></dt>
                <dd>{if $job_details.image}
                        <section class="com_logo_img_wrapp">
                        <img src="{$siteroot}/includes/image.php?width=130&amp;height=130&amp;image={$siteroot}/uploads/job/{$job_details.image}" title="job logo" alt="job logo"/>
                        </section>
                    {else}	
                    <section class="com_logo_img_wrapp">
                        <img src="{$siteroot}/uploads/job/featredjob_img1.jpg" height="130px" width="130px"  />
                        </section>
                    {/if}  
                    <input type="file" id="joblogo" name="joblogo"  style="margin-top:20px;" />     
                 </dd>
                <div class="clear"></div>
            </dl>
            
            </div>
            
            <!--Form Contain end--> 
          
           <!--Button here start-->
           <div>
            <span><input type="submit" class="admin_btn" value="Submit" name="addpostjob_btn" id="addpostjob_btn" /></span>
            <span><input type="button" class="admin_btn" value="Cancel" onclick="window.location='{$siteroot}/admin/home.php?q=postjobs&userid={$smarty.get.userid}&page={$smarty.get.page}';"/></span>
           </div>
            <!--Button here end-->
  
         </div>
         </form>
         
         </div>
        </div>
      
      
      <!--right_contain end-->
      <div class="clear"></div>
    </div>
    
{include file=$footer}